import requests

cookies = {
    'FSSBBIl1UgzbN7N80T': '3R2l80t2_KAQg51gTaPqHN3d9Sa_eLHrZ.ZJ4S.97.zHXalO5CSmBSCuZqoNpDkj6AGjwbMBK_IoYEJ3DGQf2kITNfk95raiibJjmR3h8owddUMJVkw0csfqUlbL.WQ.H.AAQ5HV9SF9Y9BNyCiof5c6Yty6zdVT3xV6rU6zfCTiWpogamk53EiHU4smBoY_Mew7cN1gHbc7tLbMfxN7a0nOiBcAq2df4VPOlnTgbQYysysoDMzaO801NNAPpKyUdDMvgNUCyzFpj4ircayAd86jjiTOG259XZUO3MZiQynC7p5k_qqBC7ZQwQx4IHtc8Q8V_R9Ycq0Y40AOMv66k17ZNfcmBo6mjNcwr8JU7v9D9Mq',
    'FSSBBIl1UgzbN7N80S': 'lNYBEd.ZCjPjPxS6.syGCIIq7DdmCD90aABEeu2w5x8W.f_QZoRS4XSRRPNzvx9I',
    'token': 'SLlnhN_z7xeXbxmW7oQfH61UjR6ob6tNsWgdYFtSELsOWRERJLiaJeZfC3Q',
}

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
    'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
    # 'Accept-Encoding': 'gzip, deflate',
    'Content-Type': 'application/x-www-form-urlencoded',
    'Origin': 'http://www.chinadrugtrials.org.cn',
    'Connection': 'keep-alive',
    'Referer': 'http://www.chinadrugtrials.org.cn/clinicaltrials.searchlist.dhtml',
    # 'Cookie': 'FSSBBIl1UgzbN7N80T=3R2l80t2_KAQg51gTaPqHN3d9Sa_eLHrZ.ZJ4S.97.zHXalO5CSmBSCuZqoNpDkj6AGjwbMBK_IoYEJ3DGQf2kITNfk95raiibJjmR3h8owddUMJVkw0csfqUlbL.WQ.H.AAQ5HV9SF9Y9BNyCiof5c6Yty6zdVT3xV6rU6zfCTiWpogamk53EiHU4smBoY_Mew7cN1gHbc7tLbMfxN7a0nOiBcAq2df4VPOlnTgbQYysysoDMzaO801NNAPpKyUdDMvgNUCyzFpj4ircayAd86jjiTOG259XZUO3MZiQynC7p5k_qqBC7ZQwQx4IHtc8Q8V_R9Ycq0Y40AOMv66k17ZNfcmBo6mjNcwr8JU7v9D9Mq; FSSBBIl1UgzbN7N80S=lNYBEd.ZCjPjPxS6.syGCIIq7DdmCD90aABEeu2w5x8W.f_QZoRS4XSRRPNzvx9I; token=SLlnhN_z7xeXbxmW7oQfH61UjR6ob6tNsWgdYFtSELsOWRERJLiaJeZfC3Q',
    'Upgrade-Insecure-Requests': '1',
}

data = {
    'id': '',
    'ckm_index': '',
    'sort': 'desc',
    'sort2': '',
    'rule': 'CTR',
    'secondLevel': '0',
    'currentpage': '1',
    'keywords': '',
    'reg_no': '',
    'indication': '',
    'case_no': '',
    'drugs_name': '',
    'drugs_type': '',
    'appliers': '',
    'communities': '',
    'researchers': '',
    'agencies': '',
    'state': '',
}

response = requests.post(
    'http://www.chinadrugtrials.org.cn/clinicaltrials.searchlist.dhtml',
    cookies=cookies,
    headers=headers,
    data=data,
).text

with open("药物信息.html","w") as fp:
    fp.write(response)